<div class="ticketPrices index">
	<h1><?php echo $ticket['Ticket']['title'];?></h1>
    <div class="bloc">
        <div class="title">
           <?php echo $this->element('admin/bread')?>
             <p>
             	<a href='javascript:;' onclick = 'addBatPrice()'>批量添加</a>
             	<?php echo $this->Html->link(__('添加'), array('action' => 'add',$ticket['Ticket']['id'])); ?>
             </p>
        </div>
        <div class="admin_view_table">
			<table cellpadding="0" cellspacing="0">
			 <thead>
				<tr>
						<th><input type = 'checkbox' value = '' id = 'select_all'/></th>
						<th><?php echo $this->Paginator->sort('id','ID'); ?></th>
						<th><?php echo $this->Paginator->sort('price','票价'); ?></th>
						<th><?php echo $this->Paginator->sort('description','说明'); ?></th>
						<th><?php echo $this->Paginator->sort('showtime','演出时间'); ?></th>
						<th><?php echo $this->Paginator->sort('eprice','电子票价'); ?></th>
						<th><?php echo $this->Paginator->sort('spt_eticket','电子票'); ?></th>
						<th><?php echo $this->Paginator->sort('sort','排序'); ?></th>
						<th><?php echo $this->Paginator->sort('ticket_price_state_id','状态'); ?></th>
						<th><?php echo $this->Paginator->sort('created','添加时间'); ?></th>
						<th><?php echo $this->Paginator->sort('modified','修改时间'); ?></th>
						<th class="actions"><?php echo __('操作'); ?></th>
				</tr>
				</thead>
			<tbody>
				<?php foreach ($ticketPrices as $ticketPrice): ?>
				<tr>
					<td><input type = 'checkbox' value = '<?php echo $ticketPrice['TicketPrice']['id']; ?>' class = 'select_sigle'/></td>
					<td><?php echo h($ticketPrice['TicketPrice']['id']); ?>&nbsp;</td>
					<td style = 'color:#57a957;text-align:right'><?php echo h($ticketPrice['TicketPrice']['price']); ?>&nbsp;</td>
					<td><?php echo h($ticketPrice['TicketPrice']['description']); ?>&nbsp;</td>
					<td><?php echo date('Y-m-d H:i',strtotime($ticketPrice['TicketPrice']['showtime'])); ?>&nbsp;</td>
					<td style = 'color:#57a957;text-align:right'><?php echo h($ticketPrice['TicketPrice']['eprice']); ?>&nbsp;</td>
					<td><?php echo h($ticketPrice['TicketPrice']['spt_eticket']); ?>&nbsp;</td>
					<td><?php echo h($ticketPrice['TicketPrice']['sort']); ?>&nbsp;</td>
					<td><?php echo h($ticketPrice['TicketPriceState']['title']); ?>&nbsp;</td>
					<td><?php echo h($ticketPrice['TicketPrice']['created']); ?>&nbsp;</td>
					<td><?php echo h($ticketPrice['TicketPrice']['modified']); ?>&nbsp;</td>
					<td class="action">
						<?php echo $this->Html->link(__('修改'), array('action' => 'edit', $ticketPrice['TicketPrice']['ticket_id'],$ticketPrice['TicketPrice']['id'])); ?>
						<a href = 'javascript:;' onclick = 'delbat(<?php echo $ticketPrice['TicketPrice']['id']?>)'>删除</a>
					</td>
				</tr>
			<?php endforeach; ?>
			</tbody>
		</table>
		</div>
        <div class="pv_page">
            <div>
				<a href = 'javascript:;' onclick = 'delbat()'>批量删除</a>            
                   | <?php
                    echo $this->Paginator->counter(array(
                        'format' => __(' 当前第{:page}页/共{:pages}页 , 当前显示{:start} 至 {:end}条记录')
                    ));
                ?>	
            </div>
            <div class="paging">
                <?php
                    echo $this->Paginator->prev('< ' . __('上一页'), array(), null, array('class' => 'prev disabled'));
                    echo $this->Paginator->numbers(array('separator' => ''));
                    echo $this->Paginator->next(__('下一页') . ' >', array(), null, array('class' => 'next disabled'));
                ?>
            </div>
        </div>
    </div>
</div>
<div id = 'bat_plice'>
	<form class = 'bat_price_form'>
		<div>
			<input type = 'checkbox' name = 'is_repeat' value = 1>复制当前日期后
			<input type = 'text' name = 'repeat' value = '0'>天
			<table style = 'width:100%'>
				<thead>
				<tr>
					<td><label>演出时间</label></td>
					<td><label>价格</label></td>
					<td><label>电子票价格</label></td>
					<td><label>支持电子票</label></td>
					<td><label>备注</label></td>
					<td><label>状态</label></td>
					<td><label>排序</label></td>
					<td><a href = 'javascript:;' onclick = 'addBatPriceCell()'>添加</a></td>
				</tr>
				</thead>
				<tbody></tbody>
			</table>
		</div>
	</form>
</div>
<style>.input_short{width:70px}.error{border:1px solid red;}</style>
<?php 
	$pso = '';
	foreach ($ticketPriceStates as $ok => $ov){
		$pso .= "<option value=$ok>$ov</option>";
	}
?>
<script>
ticket_id = "<?php echo $ticket['Ticket']['id'];?>";
ticket_date = "<?php echo date('Y-m-d').' 00:00:00'?>";
price_state_options = "<?php echo $pso?>";
$(function(){
	initBatPrice();	
	$('#select_all').click(function(){
		if($('#select_all').is(':checked')){
			$('.select_sigle').attr('checked',true);
		}else{
			$('.select_sigle').attr('checked',false);
		}
	});
});

</script>
<?php echo $this->Html->script('admin/batprice')?>